
function error = AngularError(u1, v1, u2, v2)
    vec1 = [ u1(:) v1(:) ones(numel(u1), 1) ];
    vec2 = [ u2(:) v2(:) ones(numel(u1), 1) ];
    
    vec1 = vec1 ./ repmat(sqrt(sum(vec1.^2, 2)), 1, 3);
    vec2 = vec2 ./ repmat(sqrt(sum(vec2.^2, 2)), 1, 3);
    error = rad2deg(acos(sum(vec1 .* vec2, 2)));
    error = reshape(error, size(u1));    
end